home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11001 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: uni-erlangen.de!winx03!sunshine!schoof
  2. From: schoof@informatik.uni-wuerzburg.de (Jochen Schoof)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: leap year
  5. Date: 21 Mar 1996 13:03:47 GMT
  6. Organization: University of Wuerzburg, Germany
  7. Message-ID: <4irk3j$jtn@winx03.informatik.uni-wuerzburg.de>
  8. References: <4iq64e$evq@daryl.scsn.net>
  9. NNTP-Posting-Host: wi2x01.informatik.uni-wuerzburg.de
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Scott Shrader (shrader@scsn.net) wrote:
  13. : can anyone tell me in C how do I write a program so it can tell me if a 
  14. : year is a leap year.
  15. :
  16. : Please write to me at shrader@scsn.net
  17.  
  18. As can be read in the c.l.c FAQ (question 20.32) the answer is:
  19.  
  20.   year % 4 == 0 && (year % 100 != 0 || year % 400 ==0)
  21.  
  22. This expression is true only if year is a leap year. Before 
  23. asking questions in this newsgroup, please read the FAQ to
  24. find out if the question is answered there.
  25.  
  26. - Jochen
  27.     
  28. --
  29. --------------------------------------------------------------------------
  30.  Jochen Schoof                  mailto:schoof@informatik.uni-wuerzburg.de
  31.  Lehrstuhl fuer Informatik II +-------------------------------------------
  32.  Universitaet Wuerzburg       | You are just reading a .sig-light:
  33.  D-97074 Wuerzburg (Germany)  | It is free of fat, sugar and cholesterol!
  34. ------------------------------+-------------------------------------------
  35.  WWW-Homepage:        http://www.informatik.uni-wuerzburg.de/staff/joscho
  36. --------------------------------------------------------------------------
  37.